home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / c / ExtrasLib.lha / ExtrasLib / Include / Extras / OBSOLETE / gtobject.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-30  |  7.0 KB  |  215 lines

  1. #ifndef EXTRAS_GTOBJECT_H
  2. #define EXTRAS_GTOBJECT_H
  3.  
  4. #ifndef EXEC_TYPES_H
  5. #include "exec/types.h"
  6. #endif /* EXEC_TYPES_H */
  7.  
  8. #ifndef UTILITY_TAGITEM_H
  9. #include <utility/tagitem.h>
  10. #endif /* UTILITY_TAGITEM_H */
  11.  
  12. #ifndef    GRAPHICS_GFX_H
  13. #include <graphics/gfx.h>
  14. #endif /* GRAPHICS_GFX_H */
  15.  
  16. #define GTA_Dummy    (TAG_USER)
  17.  
  18. #define GTA_DebugMode      (GTA_Dummy + 0) /* Debug Mode */
  19. #define GTA_CreateGadget   (GTA_Dummy + 1) /* (struct Gadget **) or NULL  */
  20. #define GTA_NewGadget      (GTA_Dummy + 2) /* (struct NewGadget *) */
  21.  
  22. /* 
  23.   Note: High Word of dimensions are used for relational flags.
  24.   See GTA_REL_ macros.
  25. */   
  26.  
  27. #define GTA_LeftEdge       (GTA_Dummy + 3)
  28. #define GTA_XPos           GTA_LeftEdge    /* Just an alias */
  29. #define GTA_TopEdge        (GTA_Dummy + 4)
  30. #define GTA_YPos           GTA_TopEdge
  31. #define GTA_Width          (GTA_Dummy + 5)
  32. #define GTA_Height         (GTA_Dummy + 6)
  33.  
  34. #define GTA_GadgetText     (GTA_Dummy + 7)
  35. #define GTA_TextAttr       (GTA_Dummy + 8)
  36. #define GTA_GadgetID       (GTA_Dummy + 9)
  37. #define GTA_Flags          (GTA_Dummy + 10)
  38. #define GTA_VisualInfo     (GTA_Dummy + 11)
  39. #define GTA_UserData       (GTA_Dummy + 12)
  40. #define GTA_GadgetKind     (GTA_Dummy + 13)
  41. #define GTA_GadgetTags     (GTA_Dummy + 14)   /* The next ti_Data tags are GTXX_ tags */
  42. #define GTA_GadgetTagList  (GTA_Dummy + 15)
  43. #define GTA_OffsetX        (GTA_Dummy + 16)   /* global offset from left of window - note that this will be added to GTA_UseScreenOffsets & GTA_UseWindowOffsets*/
  44. #define GTA_OffsetY        (GTA_Dummy + 17)   /* global offset from top of window */
  45. #define GTA_LabelFlags     (GTA_Dummy + 18)   /* see LGLF_ */
  46. #define GTA_ScaleX         (GTA_Dummy + 19)
  47. #define GTA_ScaleY         (GTA_Dummy + 20)   /* scale * 65535 */
  48. #define GTA_Justification  (GTA_Dummy + 21)   /* see GTA_JUST_? */
  49. #define GTA_UseScreenOffsets (GTA_Dummy + 22) /* (struct Screen *) or NULL - sets global offsets based on Window border dimensions specified in the Screen structure */
  50. #define GTA_UseWindowOffsets (GTA_Dummy + 23) /* (struct Window *) or NULL - sets global offsets based on Window border dimensions */
  51. #define GTA_EraseRemoved     (GTA_Dummy + 24) /* (BOOL) erase gadges when they're removed using GTA_RemoveGadgets (defualt TRUE ) */
  52.  
  53. #define GTA_KeyClass         (GTA_Dummy + 25) /* Not used */
  54. #define GTA_KeyString        (GTA_Dummy + 26) /* A string of characters that "activate" that gadget, if not specified, GTA_CreateGadget() will scan the gadget label for the appropriate string */
  55. #define GTA_ErrorCode        (GTA_Dummy + 27) /* Not used */
  56. /* Bounding area for gadgets */
  57.  
  58. #define GTA_Bounds           (GTA_Dummy + 28) /* (struct IBox *) set offsets of area for gadgets */
  59. /* individual tags for GTA_Bounds */
  60. #define GTA_BoundsLeft        (GTA_OffsetX)   // Aliases
  61. #define GTA_BoundsTop         (GTA_OffsetY)
  62. #define GTA_BoundsWidth       (GTA_Dummy + 29)
  63. #define GTA_BoundsHeight      (GTA_Dummy + 30)
  64.  
  65. #define GTA_RelHorizGap       (GTA_Dummy + 31)  /* Gap between certain relative operations */
  66. #define GTA_RelVertGap        (GTA_Dummy + 32)
  67.  
  68. #define GTA_HorizCells        (GTA_Dummy + 33)  /* 0 - 65535 */
  69. #define GTA_VertCells         (GTA_Dummy + 34)  /* 0 - 65535 */
  70.  
  71. #define GTA_SkipGadgets       (GTA_Dummy + 35)  /* Skip the next ti_Data GTA_CreateGadgets and all Tags in between.  */
  72.  
  73. /* Not implemented */
  74. #define GTA_SuperBounds       (GTA_Dummy + 36) /* ??? (struct IBox *) to use relative dimensions on Bounds ??? */
  75.  
  76. #define GTA_GroupGadgets
  77. #define GTA_GroupName
  78. #define GTA_GroupFlags
  79.  
  80. /* GTA_LabelFlags */
  81. #define LGLF_FITLABEL  (1<<0)
  82.  
  83. /* GTA_Justufication flags */
  84. #define GTA_JUST_HORIZ_MASK  0xf
  85. #define GTA_JUST_LEFT        0x0
  86. #define GTA_JUST_HCENTER     0x1
  87. #define GTA_JUST_RIGHT       0x2 
  88.  
  89. #define GTA_JUST_VERT_MASK   0xf0
  90. #define GTA_JUST_TOP         0x00
  91. #define GTA_JUST_VCENTER     0x10
  92. #define GTA_JUST_BOTTOM      0x20
  93.  
  94. #define GTA_JUST_WITHLABEL   0x100
  95.  
  96. /* Internal use */
  97. struct GTA_Rel_Data
  98. {
  99.   UBYTE RelGrp,Code;
  100.   union
  101.   {
  102.     WORD WData;
  103.     struct 
  104.     {
  105.       BYTE Byte1,
  106.            Byte2;
  107.     };
  108.   };
  109. };
  110.  
  111. /* Relational Macros! */
  112. #define GTA_REL_W(RelType,Code,WordData)         (ULONG)( (RelType & 0xff)<<24 | (Code & 0xff)<<16 | (WordData & 0xffff) )
  113. #define GTA_REL_BB(RelType,Code,Byte1,Byte2)     (ULONG)( (RelType & 0xff)<<24 | (Code & 0xff)<<16 | (Byte1 & 0xff )<<8 | (Byte2 & 0xff) )
  114.  
  115. /* Relative to current GTA_Bounds */
  116. #define GTA_REL_RIGHT(x)       GTA_REL_W( 1, 0, x) // GTA_LeftEdge
  117. #define GTA_REL_WIDTH(x)       GTA_REL_W( 1, 1, x) // GTA_Width
  118. #define GTA_REL_BOTTOM(y)      GTA_REL_W( 1, 2, y) // GTA_TopEdge
  119. #define GTA_REL_HEIGHT(y)      GTA_REL_W( 1, 3, y) // GTA_Height
  120.  
  121. /* cell spacing/dimensions.
  122.    These work in conjunction with the GTA_Columns & GTA_Rows tagitems, 
  123.    relative to current bounds.  GTA_RelGapX & Y are considered.
  124. */
  125. #define GTA_REL_CELL_LEFTEDGE(column)    GTA_REL_W( 1, 4, column)  // GTA_LeftEdge Horizontal spacing
  126. #define GTA_REL_CELL_TOPEDGE(row)        GTA_REL_W( 1, 5, row)     // GTA_TopEdge  Vertical spacing    
  127. #define GTA_REL_CELL_WIDTH(x)            GTA_REL_W( 1, 6, x)       // GTA_Width    the width of x columns    
  128. #define GTA_REL_CELL_HEIGHT(y)           GTA_REL_W( 1, 7, y)       // GTA_Height   the height of x rows 
  129.  
  130. /* relative to another gadget, (also considers label)
  131.    restrictions:
  132.       The gadget, GADGETID, must appear above the gadget using these 
  133.         GTA_REL_ flags in the taglist.
  134.       GAP < -128 - 127 > 
  135. */
  136.       
  137. #define GTA_REL_LEFTOF(GADGETID, GAP)    GTA_REL( 2, GAP  , GADGETID) // GTA_LeftEdge GTA_Width
  138. #define GTA_REL_TOPOF(GADGETID, GAP)     GTA_REL( 3, GAP  , GADGETID) // GTA_TopEdge  GTA_Height
  139. #define GTA_REL_WIDTHOF(GADGETID, GAP)   GTA_REL( 4, GAP  , GADGETID) // GTA_Width
  140. #define GTA_REL_HEIGHTOF(GADGETID, GAP)  GTA_REL( 5, GAP  , GADGETID) // GTA_Height
  141. #define GTA_REL_RIGHTOF(GADGETID, GAP)   GTA_REL( 6, GAP  , GADGETID) // GTA_LeftEdge GTA_Width
  142. #define GTA_REL_BOTTOMOF(GADGETID, GAP)  GTA_REL( 7, GAP  , GADGETID) // GTA_TopEdge  GTA_Height
  143.  
  144.  
  145. struct GTA_GadgetIndex
  146. {
  147.   ULONG  gi_ID;
  148.   struct Gadget *gi_Gadget;
  149.   struct Rectangle gi_Rect; /* refresh area */
  150.   ULONG  gi_Disabled,
  151.          gi_GadKind,
  152.          gi_KeyTagID,   
  153.          gi_KeyTagValue,
  154.          gi_KeyClass;
  155.   STRPTR gi_KeyString;
  156. };
  157.  
  158. struct GTA_Control
  159. {
  160.   struct Gadget *lgc_GadgetList;
  161.   ULONG  lgc_GadgetCount;
  162.   struct GTA_GadgetIndex *lgc_GadgetIndex;
  163.   ULONG  lgc_IndexCount;
  164.   struct Window *lgc_Window;
  165.   ULONG  lgc_Flags;
  166.   WORD   lgc_Left,lgc_Top,
  167.          lgc_Right,lgc_Bottom;
  168.   struct GTA_Control *lgc_Next;
  169. };
  170.  
  171. struct GTA_DimInfo
  172. {
  173.   WORD CellsHoriz , CellsVert,
  174.        GapHoriz   , GapVert;
  175. };
  176.  
  177. #define LGCF_ERASEREMOVED (1<<0)
  178.  
  179.  
  180. #define GTA_PagedGroupBegin
  181. #define GTA_Page
  182. #define GTA_PagedGroupEnd
  183.  
  184.  
  185. #define GTM_CREATEGADGET
  186. #define GTM_GETSIZE 
  187.  
  188. struct gtpCreateGadget
  189. {
  190.   ULONG MethodID;
  191.   struct NewGadget *gtpcg_NewGadget;
  192.   
  193. };
  194.  
  195.  
  196. struct gtpSize
  197. {
  198.   ULONG MethodID;
  199.   struct IBox gtps_Gadget[3];
  200.   struct IBox gtps_Label;
  201.   ULONG  gtps_LabelFlags;
  202. };
  203.  
  204. struct gtpGetSize
  205. {
  206.   ULONG MethodID;
  207.   struct IBox gtpgs_Gadget[3];
  208.   ULONG  gtpgs_Flags;
  209. };
  210.  
  211. #define GSF_NOLABEL
  212.  
  213.  
  214. #endif /* EXTRAS_GTOBJECT_H */
  215.